// 钩子函数示例
function beforeRegister({
	userRecord,
	clientInfo
} = {}) {
	if(clientInfo.appId === '__UNI__12D0CF0' ) {
		// if(userRecord.role) {
		// 	userRecord.role.push('teacher')
		// } else {
		// 	userRecord.role = ['teacher']
		// }
		if(!userRecord.nickname) {
			userRecord.nickname = "匿名" + Math.random().toString(36).substring(3,9)
		}
	}
	return userRecord // 务必返回处理后的userRecord
}

module.exports = {
	beforeRegister
}